home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group95c.txt / 000075_icon-group-sender _Mon Nov 6 09:21:39 1995.msg < prev    next >
Internet Message Format  |  1996-01-03  |  1KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 6 Nov 1995 12:26:55 MST
  2. Date: Mon, 6 Nov 1995 09:21:39 -0800
  3. From: kwalker@orville.premenos.com (Ken Walker)
  4. Message-Id: <9511061721.AA21143@orville.orville.premenos.com.>
  5. To: icon-group@cs.arizona.edu
  6. Subject: an observation on Icon semantics
  7. X-Sun-Charset: US-ASCII
  8. Errors-To: icon-group-errors@cs.arizona.edu
  9.  
  10. I few months ago there was a discussion on whether DeMorgan's Law "worked" in Icon.
  11. We concuded that it did. However, I've realized that an equivalence relationship
  12. in boolean algebra does not apply to all Icon expressions. In general,
  13.  
  14.     <expr> ~== "A"
  15.  
  16. and
  17.  
  18.     not (<expr> == "A")
  19.  
  20. produce different success/failure results when <expr> is a generator. For example
  21.  
  22.      !strings ~== "A"
  23.  
  24. succeeds if there exists an element x in strings such that x ~== "A", but
  25.  
  26.      not (!strings == "A")
  27.  
  28. succeeds if there does not exist an x in strings, such that x == "A". This is the same
  29. as saying that for all x in strings, x ~== "A". The difference in semantics is the
  30. difference between "there exists" and "for all". It's nice to know that there is a
  31. short expression like
  32.  
  33.      not (!strings ~== "A")
  34.  
  35. which succeeds when all elements of strings equal "A", but to me it looks a little
  36. perverse :-)
  37.  
  38. Ken Walker, kwalker@premenos.com
  39. Premenos Coporation, Concord, Ca. 94520
  40.